<?php

use think\facade\Route;

// 认证相关路由
Route::group('auth', function () {
    Route::post('login', 'center.Auth/login');
    Route::post('logout', 'center.Auth/logout')->middleware('JwtAuth');
    Route::post('refresh', 'center.Auth/refreshToken');
});

// 用户相关路由
Route::group('user', function () {
    Route::get('profile', 'center.User/profile');
    Route::post('add', 'center.User/add');
    Route::post('update', 'center.User/update');
});
    

// 需要认证的路由
Route::group(function () {
    // 管理员相关路由
    Route::group('admin', function () {
        Route::get('users', 'AdminController/userList');
        Route::post('users', 'AdminController/createUser');
    })->middleware('PermissionCheck');
    
})->middleware('JwtAuth');